{% extends "base_blank.volt" %}

{% block pageFooter%}
    {{ javascript_include("/js/area.js", false) }}
    {{ javascript_include("/assets/manage/js/bp/listService.js", false) }}
{% endblock %}

{% block content %}
<div class="panel panel-default">
            <div class="panel-body">
                <form class="form-inline" role="form" action="" method="get">
                   
                    <div class="form-group">
                        <div class="input-group">
                            <label class="input-group-addon" for="keyword">项目名称:</label>
                            <input class="form-control" type="text" name="servicename" id="server_name" value="{{ servicename }}" />
                            <input type="hidden" name="id" value="{{ id }}">
                        </div>  
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <label class="input-group-addon" for="keyword">状态:</label>
                            <select name="serviceState" class="form-control">
                            	<option value="-2" {% if service_state == -2 %} selected="selected" {% endif %}>全部</option>
                            	<option value="0" {% if service_state == 0 %} selected="selected" {% endif %}>未发布</option>
                            	<option value="1" {% if service_state == 1 %} selected="selected" {% endif %}>正常</option>
                            	<option value="-1" {% if service_state == -1 %} selected="selected" {% endif %}>删除</option>
                            </select>
                        </div>  
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-filter"></i> 搜 索</button>
                    </div>
                </form>
            </div>
        </div>
<div class="container-fluid" id="content_box_blank">
    <div class="row">
        <div class="col-xs-12">
            <ol class="breadcrumb">
                <li>美容院管理</li>
                <li class="active">美容院服务项目管理</li>
            </ol>
            <table class="table table-hover">
                <thead>
                <tr>
                    <th style="width: 60px;">ID</th>
                    <th style="width: 100px;">封面</th>
                    <th>服务名称</th>
                    <th>简介</th>
                    <th style="width: 60px;">价格</th>
                    <th style="width: 60px;">是否<br />销售</th>
                    <th style="width: 60px;">状态</th>
                    <th style="width: 200px;"></th>
                </tr>
                </thead>
                {% for d in serviceList %}
                <tr>
                    <td>{{ d.service_id }}</td>
                    <td><img src="{{ PicUrlBPCover(d.service_cover, this.di)  }}@!90" /></td>
                    <td>{{ d.service_name|e }}</td>
                    <td>{{ d.service_description|e }}</td>
                    <td>{{ d.service_unit ? d.service_price ~ '元/' ~ d.service_unit : d.service_price ~ '元' }}</td>
                    <td>{{ d.service_is_sell == 1 ? 'Y' : 'N' }}</td>
                    <td>{{ BPStateValue2Str(d.service_state) }}</td>
                    <td>
                        <div class="dropdown">
                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu{{ d.service_id }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><i class="fa fa-cogs"></i> 操作 <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu{{ d.service_id }}">
                                <li><a href="/frontend/share/servicePreview?id={{ d.service_id }}" target="_blank"><i class="fa fa-eye fa-fw"></i> 预览</a></li>
                                <li role="separator" class="divider"></li>
                                <li><a href="{{ url.get('bpservice/update', ['id': d.service_id]) }}"><i class="fa fa-pencil fa-fw"></i> 修 改</a></li>
                                {% if d.service_state == 0 %}
                                <li><a href="javascript:void(0)" did="{{ d.service_id }}" dstate="1" class="bp_set_state" durl="{{ url.get('bpservice/setState') }}"><i class="fa fa-paper-plane-o fa-fw"></i> 发 布</a></li>
                                {% endif %}
                                {% if d.service_state == 1 %}
                                <li><a href="javascript:void(0)" did="{{ d.service_id }}" dstate="-1" class="bp_set_state" durl="{{ url.get('bpservice/setState') }}"><i class="fa fa-trash-o fa-fw"></i> 删 除</a></li>
                                {% endif %}
                                {% if d.service_state == -1 %}
                                <li><a href="javascript:void(0)" did="{{ d.service_id }}" dstate="1" class="bp_set_state" durl="{{ url.get('bpservice/setState') }}"><i class="fa fa-reply fa-fw"></i> 恢 复</a></li>
                                {% endif %}
                            </ul>
                        </div>
                    </td>
                </tr>
                {% endfor %}
            </table>

            <div class="row">
                <div class="col-xs-12 text-center">
                    <a href="{{ url.get('bpservice/add', ['id': id]) }}" class="btn btn-primary"><i class="fa fa-plus fa-lg"></i> 添加新服务项目</a>
                </div>
            </div>

        </div>
    </div>
</div>
{% endblock %}